fix: consistent macOS deployment target for Metal compatibility#320
Open
nicholasjpaterno wants to merge 2 commits intooxiglade:mainfrom
Open
fix: consistent macOS deployment target for Metal compatibility#320nicholasjpaterno wants to merge 2 commits intooxiglade:mainfrom
nicholasjpaterno wants to merge 2 commits intooxiglade:mainfrom
Conversation
- Respects MACOSX_DEPLOYMENT_TARGET env var (defaults to 14.0) - Sets CMAKE_OSX_DEPLOYMENT_TARGET to match - Passes matching -mmacosx-version-min to linker - Adds cargo:rerun-if-env-changed for proper rebuilds Fixes ___isPlatformVersionAtLeast linking errors by ensuring all components (cmake, C++ compiler, Rust linker) use consistent target. Ref: ml-explore/mlx#1602
03bdbb0 to
af169d7
Compare
…y comment - Deduplicate MACOSX_DEPLOYMENT_TARGET resolution into a helper function - Add SAFETY comment on set_var (build scripts are single-threaded)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Ensures cmake, C++ compiler, and Rust linker all use the same macOS deployment target, preventing
___isPlatformVersionAtLeastlinking errors.MACOSX_DEPLOYMENT_TARGETenv var, defaults to 14.0 (MLX's minimum)CMAKE_OSX_DEPLOYMENT_TARGETand-mmacosx-version-minlinker flag consistentlyclang_rt.osxruntime for the___isPlatformVersionAtLeastsymbol (needed on macOS 26+)cargo:rerun-if-env-changedfor rebuild on env var changeRef: ml-explore/mlx#1602